﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using ConstructionBidOnline.Biz;

public partial class ConsultantPublicProfile : System.Web.UI.Page
{

    #region Constants

    private const string PROP_DATASRC_CERTIFICATES = "__CERTIFICATES::CERTIFICATES";

    private const string PROP_DATASRC_LICENSE = "__LICENSE::LICENSE";

    private const string PROP_DATASRC_MYJOBS = "__MYJOBS::MYJOBS";

    private const string PROP_DATASRC_CONSULTATIOINJOBS = "__CONSULTATIOINJOBS::CONSULTATIOINJOBS";

    private const string PROP_DATASRC_PORTFOLIOIMAGES = "__PORTFOLIOIMAGES::PORTFOLIOIMAGES";

    private const string PROP_DATASRC_PORTFOLIOVIDEOS = "__PORTFOLIOVIDEOS::PORTFOLIOVIDEOS";

    #endregion

    #region Public Properties

    
    public CertificatesCollection DataSourceCertificates
    {
        get { return (SessionMgr.Session[PROP_DATASRC_CERTIFICATES] is CertificatesCollection ? (CertificatesCollection)SessionMgr.Session[PROP_DATASRC_CERTIFICATES] : (CertificatesCollection)(SessionMgr.Session[PROP_DATASRC_CERTIFICATES] = new CertificatesCollection())); }
        set { SessionMgr.Session[PROP_DATASRC_CERTIFICATES] = value; }
    }

    public LicenseCollection DataSourceLicense
    {
        get { return (SessionMgr.Session[PROP_DATASRC_LICENSE] is LicenseCollection ? (LicenseCollection)SessionMgr.Session[PROP_DATASRC_LICENSE] : (LicenseCollection)(SessionMgr.Session[PROP_DATASRC_LICENSE] = new LicenseCollection())); }
        set { SessionMgr.Session[PROP_DATASRC_LICENSE] = value; }
    }

    public JobCollection DataSourceMyJobs
    {
        get { return (SessionMgr.Session[PROP_DATASRC_MYJOBS] is JobCollection ? (JobCollection)SessionMgr.Session[PROP_DATASRC_MYJOBS] : (JobCollection)(SessionMgr.Session[PROP_DATASRC_MYJOBS] = new JobCollection())); }
        set { SessionMgr.Session[PROP_DATASRC_MYJOBS] = value; }
    }

    public JobCollection DataSourceConsultationJobs
    {
        get { return (SessionMgr.Session[PROP_DATASRC_CONSULTATIOINJOBS] is JobCollection ? (JobCollection)SessionMgr.Session[PROP_DATASRC_CONSULTATIOINJOBS] : (JobCollection)(SessionMgr.Session[PROP_DATASRC_CONSULTATIOINJOBS] = new JobCollection())); }
        set { SessionMgr.Session[PROP_DATASRC_CONSULTATIOINJOBS] = value; }
    }


    public PortfoliosCollection DataSourcePortfolioImages
    {
        get { return (SessionMgr.Session[PROP_DATASRC_PORTFOLIOIMAGES] is PortfoliosCollection ? (PortfoliosCollection)SessionMgr.Session[PROP_DATASRC_PORTFOLIOIMAGES] : (PortfoliosCollection)(SessionMgr.Session[PROP_DATASRC_PORTFOLIOIMAGES] = new PortfoliosCollection())); }
        set { SessionMgr.Session[PROP_DATASRC_PORTFOLIOIMAGES] = value; }
    }

    public PortfoliosCollection DataSourcePortfolioVideos
    {
        get { return (SessionMgr.Session[PROP_DATASRC_PORTFOLIOVIDEOS] is PortfoliosCollection ? (PortfoliosCollection)SessionMgr.Session[PROP_DATASRC_PORTFOLIOVIDEOS] : (PortfoliosCollection)(SessionMgr.Session[PROP_DATASRC_PORTFOLIOVIDEOS] = new PortfoliosCollection())); }
        set { SessionMgr.Session[PROP_DATASRC_PORTFOLIOVIDEOS] = value; }
    }

    public ProfileImages profileimageObj;

    #endregion

    #region Public Variables

    public RegisteredUser consultantObj;
    public ConsultantsInformation consultantInfoObj;
    public Contracts contractObj;
    public int TotalJobCount = 0;
    public int TotalRating = 0;

    #endregion

    #region Event Handlers

    #region Page Load

    protected void Page_Load(object sender, EventArgs e)
    {
        consultantObj = RegisteredUser.GetRegisteredUserByID(ConsultantsInformation.GetConsultantsInformationByProfileID(Request.QueryString["ID"].ToString()).UserID);
        consultantInfoObj = ConsultantsInformation.GetConsultantsInformationByID(consultantObj.RegisteredUserID);
        DataSourceCertificates = Certificates.GetCertificatesByUserID(consultantObj.RegisteredUserID);
        DataSourceLicense = License.GetLicenseByUserID(consultantObj.RegisteredUserID);
        DataSourceMyJobs = Job.GetJobByUserID(consultantObj.RegisteredUserID);
        DataSourceConsultationJobs = Job.GetJobByConsultantID(consultantInfoObj.ProfileID);
        DataSourcePortfolioImages = Portfolios.GetPortfoliosByUserIDnFileType(consultantObj.RegisteredUserID, "Image");
        DataSourcePortfolioVideos = Portfolios.GetPortfoliosByUserIDnFileType(consultantObj.RegisteredUserID, "Video");
        profileimageObj = ProfileImages.GetProfileImage(consultantObj.RegisteredUserID);
    }

    #endregion

    #endregion

}
